
package com.zjff.myshop.common;

/**
 * @apiNote 首页配置项 1-（首页）轮播  2-(首页)为你推荐  3-(首页)新品上线 4-(首页)热销商品
 */
public enum HomeTypeEnum {
    DEFAULT(0, "DEFAULT"),
    HOME_CAROUSEL(1, "HOME_CAROUSEL"),
    HOME_GOODS_RECOMMOND(2, "HOME_GOODS_RECOMMOND"),
    HOME_GOODS_NEW(3, "HOME_GOODS_NEW"),
    HOME_GOODS_HOT(4, "HOME_GOODS_HOTS");

    private int id;

    private String name;

    HomeTypeEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static HomeTypeEnum getHomeTypeEnumById(int id) {
        for (HomeTypeEnum homeTypeEnum : HomeTypeEnum.values()) {
            if (homeTypeEnum.getId() == id) {
                return homeTypeEnum;
            }
        }
        return DEFAULT;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
